package mean;

import java.util.Scanner;

synchronized void deposit(int money){
	this.balance += money;
	if (this.balance >= 0) notify();
}

synchronized void withdraw(int money){
	try{
		while (this.balance - money < 0)
			wait();
	}catch (Exception e){}
    if(balance<0) 
    	this.balance -= money;
        throw new IllegalStateException(balance+"");				
}


